
class FireBaseMgr{

    constructor(){
        this.entities = new Map()
        this.e_events = new Map()
    }

    sendFbData(array){
        //调用安卓方法
        if(cc.sys.os == cc.sys.OS_ANDROID){
            let jsb = jsb || null
            if(!jsb) return
            let string = JSON.stringify(array)
            cc.log("cocos send fire base data:",string)
            // jsb.reflection.callStaticMethod("org/cocos2dx/javascript/AppActivity", "sendFireBase" ,"(String)V",string);

            var className = "org/cocos2dx/javascript/AppActivity";
            var methodName = "sendFireBase";
            // var methodSignature = "(Ljava/lang/String)V";
            var methodSignature = "(Ljava/lang/String;)V";
            jsb.reflection.callStaticMethod(className, methodName, methodSignature, string);
        }else {
            cc.warn("非android平台，不处理打点统计")
        }
    }

    sendSignUp(){
        let array = []
        array.push({key:"sign_up",value:cc.gg.dataMgr.getPlayerId()})
        this.sendFbData(array)
    }
};

export default new FireBaseMgr()